<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class LoginRecord extends Model
{
    protected $table = 'user_login_record';  //数据表
    protected $schema=[
        'user_record_id' => 'int',
        'user_id' => 'int',
        'user_login_ip' => 'string',
        'user_login_time' => 'datetime',
        'user_token' => 'string'
    ];
    protected $createTime = 'user_login_time';
    protected $pk = 'user_record_id';  //主键


    //    附表关联主表user
    public function user(){
        return $this->belongsTo(UserModel::class,'user_id');
    }

}
